home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr11
/
pdox693.zip
/
TI1147.ASC
< prev
next >
Wrap
Text File
|
1992-10-13
|
3KB
|
133 lines
PRODUCT : Paradox NUMBER : 1147
VERSION : 4.0
OS : DOS
DATE : October 13, 1992 PAGE : 1/2
TITLE : Adding Alphanumeric Fields to Form One Memo Field
This Technical Information sheet illustrates how you can use PAL
to add alphanumeric fields together to form one Memo Field.
Normally, if you wanted to add two fields together to create a
third field, you would use example elements in a query. Paradox
4.0 memo fields do not allow the use of example elements.
Instead, you must write a script to accomplish this task. In our
example, we have a table with three "A255" fields which we want
to add together to form one Memo field. First, you have to do a
Modify | Restructure and add a Memo field to your table. Then
play a script which will concatenate the three fields together
(separating the contents of each field by a space) and place the
result in a Memo field.
Note: Before making any global changes to a table, it is a good
idea to first make a backup copy of the table.
To create the script:
1. From the Paradox Menu, select Scripts | Editor | New
2. At the prompt, type in the name of your script (i.e.
FLDADD)
3. You are now in the Script Editor, type in the PAL code on
the following page.
4. When you are finished typing in the PAL code, press <F2>
to save the script.
Note: The script on the following page is an model for
concatenating text fields together and placing the result into a
Memo field. In this particular example, three text fields are
concatenated together; you can to modify your script to
concatenate any number of text fields.
PRODUCT : Paradox NUMBER : 1147
VERSION : 4.0
OS : DOS
DATE : October 13, 1992 PAGE : 2/2
TITLE : Adding Alphanumeric Fields to Form One Memo Field
;The script begins here.
Edit "Tablename" ; Place table in edit mode.
Scan ; Scan each record in table.
[MemoField] = [Field1] + " " + ; Can be used to concatenate
[Field2] + " " + ; any number of text fields.
[Field3] ; The " " separates each field
; with a space.
EndScan
Any characters after the ";", including the ";" need not be
entered. They are only comments. After playing this script, you
can do a Modify | Restructure and delete the three "A255" fields.
To play the script:
1. From the Paradox Menu, select Scripts | Play
2. At the prompt, type in the name of the script, then press
<ENTER>.
For additional information about PAL, refer to the PAL Reference
Guide and the PAL Programmer's Guide. For additional information
about Memo fields, refer to the Paradox User's Guide.
DISCLAIMER: You have the right to use this technical information
subject to the terms of the No-Nonsense License Statement that
you received with the Borland product to which this information
pertains.